#ifndef STRINGBUFFER_H_
#define STRINGBUFFER_H_

#include "String.h"

class StringBufferMetadata;

class StringBuffer:public ToStringConvertible
{
private:
	int* counter;
	StringBufferMetadata* data;

public:
	StringBuffer();
	StringBuffer(const StringBuffer&);
	virtual ~StringBuffer();
	String toString();
	StringBuffer& append(String in);
	StringBuffer& append(ToStringConvertible& in){return append(in.toString());}
	StringBuffer& operator+(String in){return append(in);}
	StringBuffer& operator+(ToStringConvertible& in){return append((String)in.toString());}
	StringBuffer& operator+=(ToStringConvertible& in){return append((String)in.toString());}
	StringBuffer& operator+=(String in){return append(in);}

	void clear();
};

#endif /* STRINGBUFFER_H_ */
